
<template>
  <div class="containerWrap">
    <div class="headWrap">
      <div class="content_title">活动管理</div>
      <div  class="search">
        <el-form :inline="true"  class="demo-form-inline searchBox">
          <el-form-item label="关键字">
            <el-input
              placeholder="关键词搜索"
              icon="search"
              :on-icon-click="searchByWord">
            </el-input>
          </el-form-item>
        </el-form>
      </div>
      <el-button @click="createActivity()" type="success" style="float: right">创建活动</el-button>
    </div>
    <div >
      <el-table
        :data="tableData"
        stripe
        style="width: 100%">
        <el-table-column
          prop="id"
          label="活动码">
        </el-table-column>
        <el-table-column
          prop="name"
          label="背景图片">
        </el-table-column>
        <el-table-column
          prop="address"
          label="活动名称">
        </el-table-column>
        <el-table-column
          prop="address"
          label="添加时间">
        </el-table-column>
        <el-table-column
          prop="address"
          label="pv">
        </el-table-column>
        <el-table-column
          prop="address"
          label="uv">
        </el-table-column>
        <el-table-column
          prop="address"
          label="操作">
          <template slot-scope="scope">
            <router-link :to="{path:'/activityManager/createEditActivity'}"><el-button  size="small">编辑活动</el-button></router-link>
            <el-button @click="download()"  size="small">下载二维码</el-button>
            <el-button  type="info" size="small" @click="activityUrl()" >活动地址</el-button>
            <el-button  type="info" size="small" @click="commentManager()">评论管理</el-button>
            <el-button  type="danger" size="small" @click="deleteActivity()">删除活动</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>


<script>
  export default {
    data () {
      return {
        tableData: [{'id': 1}],
        activeName: '0'
      };
    },
    methods: {
      // 关键字搜索
      searchByWord () {
        alert('关键字搜索');
      },
      // 编辑
      edit () {
        this.$route.push({path: '/activityManager/createEditActivity'});
        alert('编辑');
      },
      // 冻结
      freeze () {
        alert('冻结');
      },
      // 删除
//      delete () {
//        alert('删除');
//      },
      // 切换tab页签
      handleClick (tab, event) {
        this.activeName = tab.name;
        alert('切换Tab页签');
      },
      // 新建一个活动
      createActivity () {
        this.$router.push({path: '/activityManager/createEditActivity'});
      },
      commentManager () {
        this.$router.push({path: '/activityManager/commentList'});
      }
    },
    components: {},
    created: function () {
    }
  };
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
